import random


def generate_data(file_path, num_lines):

    with open(file_path, 'w') as output_file:
        for _ in range(num_lines):

            line_data = [random.uniform(0, 1) for _ in range(4)]

            output_file.write(' '.join(map(str, line_data)) + '\n')


# 示例：生成100行数据到"data.txt"文件
generate_data('data.txt', 100)
